<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
	<base href="<%=basePath%>">
	<meta charset="utf-8" />
	<link rel="stylesheet" href="front/css/bootstrap-datetimepicker.css"  type="text/css" >
	<!--下拉框 -->
	<link rel="stylesheet" href="front/css/chosen.css" type="text/css" />
	<link rel="stylesheet" href="front/css/normal.css">
	<link rel='stylesheet' href='front/css/dialog.css'>
	 <link rel="stylesheet" href="front/content/css/projectAdm.css">
	<script src="front/js/jquery-2.0.3.min.js"></script>

</head>
		
<body style='box-shadow:none'>
	<form action="borrowmoney/saveBorrowMoney.do" name="Form" id="Form" method="post" class='boxStyle'>
		<input type="hidden" name="bm_id" id="bm_id" value="${pd.bm_id}"/>
		<input type="hidden" name="task_id" id="taskId" value="${act.taskId}"/>
		<input type="hidden" name="procIns_id" id="procInsId" value="${act.procInsId}"/>
		<input type="hidden" name="flag" id="flag" value="${act.flag}"/>
		<input type="hidden" name="task_def_key" id="task_def_key" value="${act.taskDefKey}"/>
		<div id="zhongxin">
			<p class="con-title">预借款申请单</p>
			<table>
				<colgroup>
					<col width='150'>
					<col width='490'>
					<col width='150'>
					<col width='490'>
				</colgroup>
				<tbody>
					<tr>
						<td>借款人姓名</td>
						<td>${pd.USERNAME}</td>
						<td>所属部门</td>
						<td>${pd.department_name}</td>
					</tr>
					<tr>
						<td>申请单号</td>
						<td>${pd.application_no}</td>
						<td>借款事由</td>
						<td>${pd.bm_reason}</td>
					</tr>
					<tr>
						<td>借款金额</td>
						<td>${pd.bm_amount}</td>
						<td>金额大写</td>
						<td>${pd.capital}</td>
					</tr>
					<tr>
						<td>借款方式</td>
						<td>
							<c:if test="${pd.bm_way==0}" >现金</c:if>
							<c:if test="${pd.bm_way==1}" >转账</c:if>
							<c:if test="${pd.bm_way==2}" >其它</c:if>
						</td>
						<td>申请日期</td>
						<td>${pd.bm_time}</td>
					</tr>
					<tr>
						<td>预计还款日期</td>
						<td>${pd.repayment_time}</td>
						<td>最迟到账时间</td>
						<td>${pd.accounting_date}</td>
					</tr>
					<tr>
						<td>账户名称</td>
						<td>${pd.bm_account}</td>
						<td>银行账号</td>
						<td>${pd.bm_card_numbers}</td>
					</tr>
					<tr>
						<td>开户银行</td>
						<td colspan="3">${pd.opening_bank}</td>
					</tr>
					<tr>
						<td>您的意见</td>
						<td colspan="3">
							<textarea style='width:100%;height:40px;box-sizing:border-box'></textarea>
						</td>
					</tr>
				</tbody>
			</table>
			<c:if test="${pd.bm_attach_path  !=null && pd.bm_attach_name !=''}">
				<p>
					点击下载：<a class="btn btn-mini btn-primary" href="192.168.198.251:8080/${pd.bm_attach_path}">${pd.bm_attach_name}</a>
				</p>
			</c:if>
		</div>
		<p class="btn-box">
        	<button onclick="agree()">同 意</button>
        	<button onclick="noagree()">驳 回</button>
			<button onclick="javascript:history.back(-1);">返回</button>
		</p>
	</form>
		<div style="height: 13px;"></div>
		
    	<div class="boxStyle">
	    		<p class='con-title'>审核流程信息</P>
	    		<div id="histoicFlowList">
					<table class="table table-striped table-bordered table-condensed">
						<tr><th>执行环节</th><th>执行人</th><th>开始时间</th><th>结束时间</th><th>提交意见</th><th>任务历时</th></tr>
						<c:forEach items="${varList}" var="act">
							<tr>
								<td>${act.histIns.activityName}</td>
								<td>${act.assigneeName}</td>
								<td><fmt:formatDate value="${act.histIns.startTime}" type="both"/></td>
								<td><fmt:formatDate value="${act.histIns.endTime}" type="both"/></td>
								<td style="word-wrap:break-word;word-break:break-all;">${act.comment}</td>
								<td>${act.durationTime}</td>
							</tr>
						</c:forEach>
					</table>
				</div>
    	</div>
		<script src="front/js/jquery-2.0.3.min.js"></script>
		<script src="front/js/jquery.tips.js"></script>
		<script src="front/js/index.js"></script>
		<script type="text/javascript">
		function agree(){
			$('#flag').val('yes');
			$.ajax({
				type: "POST",
				url: $("#Form").attr("action"),
		    	data: $("#Form").serialize(),
				dataType:'json',
				cache: false,
				success: function(data){
					if(data.msg == "success"){
						alert("审批成功!");
						location.href = "<%=basePath%>acttask/todo.do";
					}
				}
			});
		}
		
		function noagree(){
			$('#flag').val('no');
			$.ajax({
				type: "POST",
				url: $("#Form").attr("action"),
		    	data: $("#Form").serialize(),
				dataType:'json',
				cache: false,
				success: function(data){
					if(data.msg == "success"){
						alert("驳回成功!");
						location.href = "<%=basePath%>acttask/todo.do";
					}
				}
			});
		}
		
		 $(function() {
	    	 //下拉框
		     $(".select").chosen();
			 //下拉框
		     var way=$("#bm_way").val();
				if(way=='0'){
					$(".accountclass").hide();
				}else{
					$(".accountclass").show();
				}
		})
		
		</script>
</body>
</html>